package cn.zwx.goods.svc.rpc.dto;

import lombok.Data;
import org.apache.dubbo.apidocs.annotations.RequestParam;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author zhangwenxue
 */
@Data
public class BuilderSkuDTO  implements Serializable {

    @NotBlank(message = "skuId不能为空")
    @RequestParam(value = "0",description = "SkuId",required = true)
    private String skuId;
    /**
     * SKU名称
     */
    @NotBlank(message = "SKU名称")
    @RequestParam(value = "0",description = "价格",required = true)
    private String name;

    /**
     * 价格（分）
     */
    @NotNull(message = "价格不能为空")
    @RequestParam(value = "0",description = "价格",required = true)
    private Long price;

    /**
     * 市场价格 单位分
     */
    @NotNull(message = "市场价格不能为空")
    @RequestParam(value = "0",description = "市场价格",required = true)
    private Long marketPrice;

    /**
     * 预警数量值
     */
    @RequestParam(value = "0",description = "预警数量值")
    private Integer preWarningNum;

    /**
     * 库存数量
     */
    @NotNull(message = "库存数量不能为空")
    @RequestParam(value = "0",description = "库存数量",required = true)
    private Integer num;

    /**
     * 商品图片
     */
    @NotBlank(message = "商品图片不能为空")
    @Length(max = 256,message = "商品图片不能超过256位")
    @RequestParam(value = "0",description = "商品图片",required = true)
    private String image;

    /**
     * 商品图片列表
     */
    @NotBlank(message = "商品图片列表不能为空")
    @Length(max = 1024,message = "商品图片列表不能超过1024位")
    @RequestParam(value = "0",description = "商品图片列表",required = true)
    private String images;


    /**
     * 商品条形码
     */
    @NotNull(message = "商品条形码不能为空")
    @RequestParam(value = "0",description = "商品条形码",required = true)
    private String modelId;

    /**
     * 商品重量
     */
    @NotNull(message = "商品重量不能为空")
    @RequestParam(value = "0",description = "商品重量",required = true)
    private Double weight;

    /**
     * 商品体积
     */
    @NotNull(message = "商品体积不能为空")
    @RequestParam(value = "0",description = "商品体积",required = true)
    private Double volume;

    /**
     * 排序值
     */
    @NotNull(message = "排序值不能为空")
    @RequestParam(value = "0",description = "排序值",required = true)
    private Integer sort;

    @Valid
    @NotNull(message = "sku属性不能为空")
    private List<BuilderAttrDTO> attrSkuList;

}
